/**
 * @author wangpeizhi
 * @describe 原生aes加密  传入原始数据  return 加密/解密值
 */

/**
  * 加密
  * @param {*} encrypted
  */
export function aesEncrypt(encrypted) {
  const sys = localStorage.getItem('sys')
  let encrypt = ''
  if (sys === 'Android') {
    encrypt = window.AndroidWebView.aesEncrypt(encrypted)
  } else {
    encrypt = window.prompt('aesEncrypt', encrypted)
  }
  return encrypt
}

/**
 * 解密
 * @param {*} encrypted
 */
export function aesDecrypt(encrypted) {
  const sys = localStorage.getItem('sys')
  let decrypt = ''
  if (sys === 'Android') {
    decrypt = window.AndroidWebView.aesDecrypt(encrypted)
  } else {
    decrypt = window.prompt('aesDecrypt', encrypted)
  }
  return decrypt
}
